package ca.cbc.medialib.entity;

import javax.xml.bind.annotation.XmlTransient;

import java.util.Date;

@XmlTransient
public class Release {

    @XmlTransient
    public static class Builder {
        public static Builder getBuilder() {
            return new Builder();
        }
        private long id;
        private long mediaId;
        private String delivery;
        private Date addedDate;
        private Date updatedDate;
        private String releaseUrl;
        private long yospaceId;
        private long mediaFileId;

        public Release buildNew() {
            Release m = new Release(id, mediaId, delivery, addedDate, updatedDate, releaseUrl, yospaceId, mediaFileId);
            return m;
        }
        
        public Builder withAddedDate(Date addedDate) {
            this.addedDate = addedDate;
            return this;
        }

        public Builder withDelivery(String delivery) {
            this.delivery = delivery;
            return this;
        }

        public Builder withId(long id) {
            this.id = id;
            return this;
        }

        public Builder withMediaFileId(long mediaFileUri) {
        	this.mediaFileId = mediaFileUri;
        	return this;
        }

        public Builder withMediaId(long mediaId) {
            this.mediaId = mediaId;
            return this;
        }

        public Builder withReleaseUrl(String releaseUrl) {
            this.releaseUrl = releaseUrl;
            return this;
        }

        public Builder withUpdatedDate(Date updatedDate) {
            this.updatedDate = updatedDate;
            return this;
        }

        public Builder withYospaceId(long yospaceId) {
            this.yospaceId = yospaceId;
            return this;
        }
    }
    
    private final long id;
    private final long mediaId;
    private final String delivery;
    private final Date addedDate;
    private final Date updatedDate;
    private final String releaseUrl;
    private final long yospaceId;
    private final long mediaFileId;

    public Release(long id, long mediaId, String delivery, Date addedDate, Date updatedDate, String releaseUrl, long yospaceId, long mediaFileId) {
        this.id = id;
        this.delivery = delivery;
        this.mediaId = mediaId;
        this.addedDate = addedDate;
        this.updatedDate = updatedDate;
        this.releaseUrl = releaseUrl;
        this.yospaceId = yospaceId;
        this.mediaFileId = mediaFileId;
    }

	public Date getAddedDate() {
        return addedDate;
    }

    public String getDelivery() {
        return delivery;
    }

    public long getId() {
        return id;
    }

    public long getMediaFileId() {
		return mediaFileId;
	}

    public long getMediaId() {
        return mediaId;
    }

    public String getReleaseUrl() {
        return releaseUrl;
    }

    public Date getUpdatedDate() {
        return updatedDate;
    }

    public long getYospaceId() {
        return yospaceId;
    }
}
